package org.example.oa;


import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author tangxiao
 */
@SpringBootApplication
@MapperScan(basePackages = "org.example.oa.*.mapper")
public class Application {
    public static void main(String[] args) {

        SpringApplication.run(Application.class, args);
    }

    @Configuration
    @ConditionalOnClass(value = {PaginationInnerInterceptor.class})
    public class MybatisPlusConfig {
        @Bean
        public PaginationInnerInterceptor paginationInterceptor() {
            PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor();
            return paginationInterceptor;
        }
    }
}
